<?php global $concerto;?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
	<head>
		<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
		<link href="<?=getCommonFile('concerto/css/reset.css')?>" rel="stylesheet" type="text/css" />
		<link rel="stylesheet" type="text/css" href="<?=getCommonFile('concerto/torchd.framework/torchd.ui.css')?>"/>
		<link href="<?=getCommonFile('concerto/admin/style.css')?>" rel="stylesheet" type="text/css" />
		<link rel="shortcut icon" href="/images/favicon.ico"/>
		<title>Concerto Administration Panel</title>
		<?php Modulator()->includeScript('jquery');?>
		<?php Modulator()->includeScript('jquery ui');?>
		<script type="text/javascript" src="<?=getCommonFile('concerto/javascript/concerto.js')?>"></script>
		<script type="text/javascript" src="<?=getCommonFile('concerto/torchd.framework/combine.js')?>"></script>
		<script type="text/javascript" src="<?=getCommonFile('third-party/typing/typing.js')?>"></script>
		
		<script type="text/javascript" src="<?=getCommonFile('concerto/admin/menus/topMenu.js')?>"></script>
		<script type="text/javascript" src="<?=getCommonFile('concerto/admin/concerto.admin.js')?>"></script>
		<script type="text/javascript" src="<?=getCommonFile('concerto/admin/livesearch.js')?>"></script>
		<script type="text/javascript" src="<?=getCommonFile('concerto/admin/navMenuEditor.js')?>"></script>
		<script type="text/javascript">
			concerto.admin.rootUrl = '<?=CN_URL?>';

			
			$(document).ready(function() {
				
				torchd.ui.showMenu(topMenu);
				
				$('<li/>').addClass('menu-user-info').html('Welcome, <b><?=displayName()?></b>. <a target="_blank" href="<?=CN_URL?>?view=form&form=edit_profile">Edit Profile</a> | <a href="<?=CN_URL?>?action=logout">Logout</a>').appendTo($('.torchd-ui-menu'));
				$('<li/>').addClass('menu-concerto-logo').prependTo($('.torchd-ui-menu')).click(function() {
					concerto.admin.loadPanel('home');
				});
				$('<li/>').addClass('menu-geek-mode').appendTo($('.torchd-ui-menu')).click(function() {
					concerto.admin.toggleGeekMode();
				});
				$('.select-all').live('click', function() {
					if($(this).attr('checked')) {
						$(this).parent('th').parent('tr').parent('thead').parent('table').find('.selectee-all').attr('checked', 'checked');
						$(this).parent('th').parent('tr').parent('thead').parent('table').find('.select-all').attr('checked', 'checked');
					}
					else {
						$(this).parent('th').parent('tr').parent('thead').parent('table').find('.selectee-all').attr('checked',  false);
						$(this).parent('th').parent('tr').parent('thead').parent('table').find('.select-all').attr('checked',  false);
					}
				});
				
				$('.selectee-all').live('click', function() {
					if(!$(this).attr('checked')) {
						$(this).parent('td').parent('tr').parent('tbody').parent('table').find('.select-all').attr('checked', false);
					}
				});
				$('.page-number, .next-previous').live('click', function(e) {
					e.preventDefault();
					$.ajax({
						url:$(this).attr('href'),
						beforeSend:function() {
							$('#main').fadeOut(200);
						},
						success:function(response) {
							$('#main').html(response).fadeIn(100);
						}
					});
				});
				concerto.admin.reloadDynamicMenus();
				concerto.admin.init();
			});
		</script>
		<?php $this->Panel->header();?>
		<?php Modulator()->runFunction('admin_header');?>
	</head>
	<body>
		<header id="top">
		<h1 class="home">Welcome to Concerto.</h1>
		</header>
		<div id="content">
			<div id="sidebar">
			
			</div>
			<div id="main">